<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    ul li {
        position: relative;
        list-style: none;
        float: left;
        width: 180px;
        height: 320px;
        border: 1px solid red;
        margin-left: -1px;
    }
    /* ul li:hover{
        1.如果盒子没有定位，则加相对定位即可
        position: relative;
        border: 1px solid blue;
    } */
    ul li:hover{
       /* 2.如果li都有定位，则利用z-index提高层级 */
        z-index: 1;
        border: 1px solid blue;
    }
</style>
<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>

</html>